package main

import (
	"gorule/core"
	"log"
)

func main()  {
	ctx := core.NewContext()
	ctx.Set("text", "")
	rule1 := core.Rule(
		func(ctx *core.Context) bool {
			return true
		},
		func(ctx *core.Context) {
			log.Println("rule1")
		},
	)

	rule2 := core.AndRule(
		core.Rule(
			func(ctx *core.Context) bool {
				return true
			},
			func(ctx *core.Context) {},
		),
		core.Rule(
			func(ctx *core.Context) bool {
				return true
			},
			func(ctx *core.Context) {
				log.Println("rule2")
			},
		),
	)

	parser := core.RuleGroup(
		rule1,
		rule2,
	)
	parser.Parse(&ctx)

}